
BUI.use('common/main',function(){
	$.getJSON('privileges',function (map) {
        sessionStorage.setItem('privileges',map.privileges);
        var channelData= map.channelData;
        var arrayStr='';
        for(var i=0;i<channelData.length;i++){
            arrayStr=arrayStr+channelData[i].href+'-'+channelData[i].text+',';
        }
        sessionStorage.setItem('channelData',arrayStr);
    });
    $.getJSON('menu',function(menuData){
        var menus=[];
        for(var i=0;i<menuData.length;i++){
            var menuArray=[menuData[i]];
            var baseMenu={id:menuData[i].id,homePage:menuData[i].items[0].id,menu:menuArray};
            menus[i]=baseMenu;
        }
        new PageUtil.MainPage({
            modulesConfig : menus
        });
    });
});